<?php

/**
 * ElecTarrif form base class.
 *
 * @package    utility
 * @subpackage form
 * @author     Your name here
 */
class BaseElecTarrifForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'tarrif_id'    => new sfWidgetFormPropelChoice(array('model' => 'Tarrif', 'add_empty' => true)),
      'title'        => new sfWidgetFormInput(),
      'from_unit'    => new sfWidgetFormInput(),
      'to_unit'      => new sfWidgetFormInput(),
      'civil_rate'   => new sfWidgetFormInput(),
      'rebate_rate'  => new sfWidgetFormInput(),
      'officer_rate' => new sfWidgetFormInput(),
      'status'       => new sfWidgetFormInput(),
      'created_at'   => new sfWidgetFormDate(),
      'updated_at'   => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorPropelChoice(array('model' => 'ElecTarrif', 'column' => 'id', 'required' => false)),
      'tarrif_id'    => new sfValidatorPropelChoice(array('model' => 'Tarrif', 'column' => 'id', 'required' => false)),
      'title'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'from_unit'    => new sfValidatorInteger(array('required' => false)),
      'to_unit'      => new sfValidatorInteger(array('required' => false)),
      'civil_rate'   => new sfValidatorNumber(array('required' => false)),
      'rebate_rate'  => new sfValidatorNumber(array('required' => false)),
      'officer_rate' => new sfValidatorNumber(array('required' => false)),
      'status'       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'created_at'   => new sfValidatorDate(array('required' => false)),
      'updated_at'   => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('elec_tarrif[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ElecTarrif';
  }


}
